<!doctype html>
<html>
<head>
    <title>查看三测单</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">-->
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <link rel="stylesheet" type="text/css" href="../../css/jquery.mobile-1.4.0.css" />
    <link rel="stylesheet" type="text/css" href="../../css/zpdydhl_mobile.css">
    <link rel="stylesheet" type="text/css" href="../../css/mobiscroll.custom-2.6.2.min.css">
    <script type="text/javascript" src="../../js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="../../js/jquery.mobile-1.4.0.min.js"></script>
    <script type="text/javascript" src="../../js/zpdydhl_mobile.js"></script>
    <script type="text/javascript" src="../../js/mobiscroll.custom-2.6.2.min.js"></script>
	<script type="text/javascript" src="../../js/auto_screen.js"></script>
	<style type="text/css">
		.pre_week {
		    background: rgba(0, 0, 0, 0) url("../../css/images/pre_week.png") no-repeat scroll 0 0;
		    display: block;
		    height: 200px;
		    position: fixed;
		    left: 2px;
		    top: 80px;
		    width: 32px;
		    z-index: 1002;
		}
		.next_week {
		    background: rgba(0, 0, 0, 0) url("../../css/images/next_week.png") no-repeat scroll 0 0;
		    display: block;
		    height: 200px;
		    position: fixed;
		    right: 2px;
		    top: 80px;
		    width: 32px;
		    z-index: 1002;
		}
		/*加载loding*/
        .spinner {
          margin: 5px auto 0;
          width: 150px;
          text-align: center;
          position: fixed;
        }

        .spinner > div {
          width: 20px;
          height: 20px;
          background-color: #67CF22;

          border-radius: 100%;
          display: inline-block;
          -webkit-animation: bouncedelay 1.4s infinite ease-in-out;
          animation: bouncedelay 1.4s infinite ease-in-out;
          /* Prevent first frame from flickering when animation starts */
          -webkit-animation-fill-mode: both;
          animation-fill-mode: both;
        }

        .spinner .bounce1 {
          -webkit-animation-delay: -0.32s;
          animation-delay: -0.32s;
        }

        .spinner .bounce2 {
          -webkit-animation-delay: -0.16s;
          animation-delay: -0.16s;
        }

        @-webkit-keyframes bouncedelay {
          0%, 80%, 100% { -webkit-transform: scale(0.0) }
          40% { -webkit-transform: scale(1.0) }
        }

        @keyframes bouncedelay {
          0%, 80%, 100% {
            transform: scale(0.0);
            -webkit-transform: scale(0.0);
          } 40% {
            transform: scale(1.0);
            -webkit-transform: scale(1.0);
          }
        }
        /*end*/
	</style>
</head>
<body>
    <div data-role="page" data-theme="c" id="page">
          <a href="" class="pre_week" alt="前一页" title="前一页"></a>
           <a href="" class="next_week" alt="后一页" title="后一页"></a>
        <div class="ui-content" >
           
        </div>
    </div>
    <script type='text/javascript'>
        $(function () {
		    
        	//点击返回按钮
            $(".go_back").die().live("click",function(){
				window.location.href="../Patient/showTizhengList.html";
			});
            $(".tupian_tiaozheng").on("click",function(){
                width = parseInt($(".sancedan_img").css("width"));
                height = parseInt($(".sancedan_img").css("height"));
                //放大倍数
                multiple = 2;
                
                if($(this).attr("id") == "tupian_fangda"){
                    width*=multiple;
                    height*=multiple;
                }else{
                    width/=multiple;
                    height/=multiple;
                }
                $(".sancedan_img").css("width",width+"px");
                $(".sancedan_img").css("height",height+"px");
                
            });
            count = getRequestOne("count");
			temp_count = count; 
			
			
            page_before_tizhenglishi = getRequestOne("page_before_tizhenglishi");
			tizheng_jiancha_date = getRequestOne("tizheng_jiancha_date");
		
            $("#fanhui_tizhengluru").live("click",function(){
                window.location.href = "./showTizheng.html?count="+count+"&tizheng_jiancha_date="+tizheng_jiancha_date+"&page_before_tizhenglishi="+page_before_tizhenglishi;
            });
			
	
		


			$(".pre_week").live("click",function(){
			    temp_count = eval(temp_count-1);	
			    showSancedan(temp_count);	
			    
			});
			$(".next_week").live("click",function(){
				temp_count =  eval(temp_count+"+"+1);	
                showSancedan(temp_count);				
			});
			
			
        });
		function refreshData()
		{
			
			showSancedan(count);
		}
		function showSancedan(count){
			
            
           // var temp_url = server_url+"Mobile/Tizheng/showSancedan/version/v3/zhuyuan_id/"+patient_info_global.zhuyuan_id+"/jiancha_date/"+tizheng_jiancha_date;
		   var temp_url = server_url+"TiwenJiludan/showSancedanforSvg/zhuyuan_id/"+patient_info_global.zhuyuan_id+"/count/"+count+"/source/pda";

            $.ajax({
                type: "get",
                async: true,
                url:temp_url,
                data:{},
                dataType: "jsonp",
                jsonp: "callbackShowSancedan",
                jsonpCallback:"feedBackStateShowSancedan",
              //  error:function(mes)
               // {
               //     alert("请求失败，请稍后重试");
               // },
				beforeSend: loading,
                success: function(result) {
                    if(result.ret=="success")
                    {   
                        $('.ui-content').html(result.data.svg);
						if(result.data.count<=1)
						   $(".pre_week").hide();
						else
						   $(".pre_week").show();
						if(result.data.count>=result.data.week_count)
						   $(".next_week").hide();						   
						else
						    $(".next_week").show();
												
						temp_count = result.data.count;						
						var svgRootDom = $("#sketchpad")[0];  						
		             	adjustToFreezeWidth(svgRootDom); 
						 /*加载loding消失*/
						$('#m').remove();
						$('#lo').remove();
						/*end*/
                    }
                    else
                    {
                        alert("三册单还没有完成，请稍后重试");
                    }
                }
            });
		}
    </script>
</body>
</html>
